package com.devframe.sysbase.model.base;

import java.io.Serializable;

import com.devframe.sysbase.model.*;
/**
 * This is an object that contains data related to the T_SYS_ROLE_RIGHTS table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="T_SYS_ROLE_RIGHTS"
 */

public abstract class BaseTSysRoleRights  implements Serializable {

	public static String REF = "TSysRoleRights";
	public static String PROP_RIGHT_CODE = "rightCode";
	public static String PROP_ROLE = "role";
	public static String PROP_ID = "id";


	// constructors
	public BaseTSysRoleRights () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTSysRoleRights (java.lang.String id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.String id;

	// fields
	private java.lang.String rightCode;

	// many to one
	private TSysRole role;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="uuid.hex"
     *  column="ID"
     */
	public java.lang.String getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.String id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: RIGHT_CODE
	 */
	public java.lang.String getRightCode () {
		return rightCode;
	}

	/**
	 * Set the value related to the column: RIGHT_CODE
	 * @param rightCode the RIGHT_CODE value
	 */
	public void setRightCode (java.lang.String rightCode) {
		this.rightCode = rightCode;
	}



	/**
	 * Return the value associated with the column: ROLE_CODE
	 */
	public TSysRole getRole () {
		return role;
	}

	/**
	 * Set the value related to the column: ROLE_CODE
	 * @param role the ROLE_CODE value
	 */
	public void setRole (TSysRole role) {
		this.role = role;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof TSysRoleRights)) return false;
		else {
			TSysRoleRights tSysRoleRights = (TSysRoleRights) obj;
			if (null == this.getId() || null == tSysRoleRights.getId()) return false;
			else return (this.getId().equals(tSysRoleRights.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}